<template>
  <component :is="componentName" :rowData="rowData" @subPage="subPage"></component>
</template>
<script setup lang="ts" name="individualAccount">
import TableModel from './tableModel.vue'
import transactionRecord from './transactionRecord.vue'

const rowData = ref(undefined)
const componentName: Record<string, any> = ref(TableModel)
const pageList = [TableModel, transactionRecord]
const subPage = (index: number, row?: object) => {
  componentName.value = pageList[index]
  if (index === 1) {
    rowData.value = row
  }
}
</script>
